package com.demo.core.model;

import java.util.HashMap;
import java.util.Map;

import com.demo.core.model.support.NestedSetModel;

/**
 * 区域(地区)模型 
 * 提供区域数据
 * @author ryuu.kk
 *
 */
public class Area extends NestedSetModel {

	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = -82860740437016502L;

	/**
	 * 类型：实际类型
	 */
	public static final String AREA_TYPE_REAL = "A";
	
	/**
	 * 类型：虚拟类型
	 */
	public static final String AREA_TYPE_VIRTUAL = "V";
	
	/**
	 * 站点外键ID
	 */
	private Long siteId;
	
	/**
	 * 区域名称
	 * @see NestedSetModel {@link NestedSetModel}
	 */
	//private String name;
	
	/**
	 * 区域码
	 */
	private String code;
	
	/**
	 * 是否可用
	 */
	private boolean enabled;
	
	/**
	 * 数据的国际化编码
	 */
	private String i18n;
	
	/**
	 * 区域类型
	 * A：实体类型
	 * V：虚拟类型
	 */
	private String type;
	
	/**
	 * 描述
	 */
	private String description;
	
	/**
	 * 区域表达式
	 * 该表达式是一个区域的数据表达式,提供图的画法功能
	 */
	private String expression;
	
	public Long getSiteId() {
		return siteId;
	}

	public void setSiteId(Long siteId) {
		this.siteId = siteId;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getExpression() {
		return expression;
	}

	public void setExpression(String expression) {
		this.expression = expression;
	}
	
	public static void main(String[] args) {
		Area area = new Area();
		area.setId(10L);
		
		Area area2 = new Area();
		
		area2.setId(11L);
		
		Area area3 = new Area();
		
		area3.setId(10L);
		
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", 1);
		params.put("key", "abc");
		
		Map<String, Object> params2 = new HashMap<String, Object>();
		params2.put("key", "abc");
		params2.put("id", 1);

		Map<String, Object> params3 = new HashMap<String, Object>();
		params3.put("key", "abc");
		params3.put("id", 2);
		
		System.out.println(params.hashCode());
		System.out.println(params2.hashCode());
		System.out.println(params3.hashCode());
		System.out.print(area.hashCode() + " - " + area2.hashCode() + " - " + area3.hashCode());
		
	}
}
